package br.ufrj.dcc.comp2.musica.vista;

import java.awt.Component;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.BorderFactory;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import br.ufrj.dcc.comp2.musica.controle.ControleCardLayout;

public class PainelInfoAlunoEditavel extends JPanel{

	private static final long serialVersionUID = 1L;
	private JLabel labelNome;
	private JLabel labelSobrenome;
	private JLabel labelCurso;
	private JLabel labelDRECargo;
	//private JLabel labelPeriodoAtual;
	private JLabel labelRG;
	private JLabel labelCpf;
	
	private JTextField campoNome;
	private JTextField campoSobreNome;
	private JComboBox campoNomeCurso;
	private JTextField campoDreCargo;
	private JTextField campoRG;
	private JTextField campoCpf;
	//private JTextField campoDataPeriodoAtual;
	
	private GridBagLayout gridBagLayout;
	private GridBagConstraints gridBagConstraints;
	private ControleCardLayout controleCardLayout;

	public ControleCardLayout getControleCardLayout() {
		return controleCardLayout;
	}
	public PainelInfoAlunoEditavel() {

		labelNome = new JLabel("Nome: *");
		labelSobrenome = new JLabel("Sobrenome: *");
		labelCurso = new JLabel("Curso: *");
		labelDRECargo = new JLabel("Dre: *");
		labelRG = new JLabel("RG: *");
		labelCpf = new JLabel("Cpf: *");
		//labelPeriodoAtual = new JLabel("Periodo atual: ");
		//labelAluno.setHorizontalAlignment(JLabel.RIGHT);
		//labelDRE.setHorizontalAlignment(JLabel.RIGHT);
		
		campoNome = new JTextField(18);
		campoSobreNome = new JTextField(18);
		campoNomeCurso = new JComboBox();
		campoDreCargo = new JTextField(18);
		campoRG = new JTextField(18);
		campoCpf = new JTextField(18);
		
		//campoDataPeriodoAtual = new JTextField(18);
		
		gridBagLayout = new GridBagLayout();
		gridBagConstraints = new GridBagConstraints();
		
		this.setLayout(gridBagLayout);
		this.setBorder(BorderFactory.createTitledBorder("Dados Pessoais"));

		adicionar(labelNome, 1, 0);
		adicionar(labelSobrenome, 1, 1);
		adicionar(labelDRECargo, 1, 2);
		adicionar(labelCurso, 1, 3);
		adicionar(labelRG, 1, 4);
		adicionar(labelCpf, 1, 5);
		//adicionar(labelPeriodoAtual, 1, 3);
		
		
		adicionar(campoNome, 2, 0);
		adicionar(campoSobreNome, 2, 1);
		adicionar(campoDreCargo, 2, 2);
		adicionar(campoNomeCurso, 2, 3);
		adicionar(campoRG, 2, 4);
		adicionar(campoCpf, 2, 5);
		//adicionar(campoDataPeriodoAtual, 2, 3);
		

	}

	public void adicionar(Component c, int x, int y) {
		gridBagConstraints.fill = GridBagConstraints.NONE;
		gridBagConstraints.gridx = x;
		gridBagConstraints.gridy = y;
		// espacamento entre os componentes
		gridBagConstraints.insets = new Insets(5, 5, 5, 5);

		add(c, gridBagConstraints);
	}

	public JTextField getCampoNomeAluno() {
		return campoNome;
	}

	public JComboBox getCampoNomeCurso() {
		return campoNomeCurso;
	}

	public JTextField getCampoDreCargo() {
		return campoDreCargo;
	}

	public JTextField getCampoRG() {
		return campoRG;
	}

	public JTextField getCampoCpf() {
		return campoCpf;
	}
	public JLabel getLabelCurso() {
		return labelCurso;
	}
	public JLabel getLabelDRECargo() {
		return labelDRECargo;
	}
	public JTextField getCampoSobreNome() {
		return campoSobreNome;
	}
}
